home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_iichknname.asp < prev    next >
Encoding:
Text File  |  1999-06-03  |  1.7 KB  |  78 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4.  
  5. <!--#include file="iichknname.str"-->
  6.  
  7. <%
  8. On Error Resume Next
  9. Const SERVERTYPE = "Server"
  10. Const SITE = 0
  11. Const VDIR = 1
  12. Const DIR = 2
  13.  
  14. Dim nname, nntype,ppath, failed, cntrl,ParentObj, node, onfail, donext
  15.  
  16. nname=lcase(Request.QueryString("nname"))
  17. nntype = cInt(Request.QueryString("nntype"))
  18. ppath=Request.QueryString("ppath")
  19. cntrl=Request.QueryString("cntrl")
  20. onfail=Request.QueryString("onfail")
  21. donext=Request.QueryString("donext")
  22.  
  23. Response.write nntype & "<BR>"
  24. failed = false
  25.  
  26.  
  27. Set ParentObj=GetObject(ppath)
  28. Dim FileSystem, f, folder
  29. if nntype = DIR then
  30.     Response.write ParentObj.Path
  31.     Set FileSystem=CreateObject("Scripting.FileSystemObject")
  32.     if FileSystem.FolderExists(ParentObj.Path) then    
  33.         Set f=FileSystem.GetFolder(ParentObj.Path)
  34.         For Each folder In f.SubFolders
  35.             if nname = lcase(folder.name) then
  36.                 failed = true
  37.                 exit for
  38.             end if
  39.         Next
  40.     end if
  41. else
  42.     for each node in ParentObj
  43.     
  44.         if InStr(node.KeyType,SERVERTYPE) then
  45.             Response.write node.ServerComment & "<BR>"
  46.             if nname = lcase(node.ServerComment) then
  47.                 failed = true            
  48.                 exit for
  49.             end if
  50.         else
  51.             Response.write node.name & "<BR>"
  52.             if nname = lcase(node.name) then
  53.                 failed = true
  54.                 exit for
  55.             end if
  56.         end if
  57.     next
  58. end if
  59. Response.write err
  60. %>
  61.  
  62. <HTML>
  63. <BODY>
  64. <SCRIPT LANGUAGE="JavaScript">
  65.     <% if failed then %>
  66.         alert("<%= L_SELECTUNIQUENAME_TEXT %>");
  67.         <% if onfail <> "" then %>
  68.             <%=onfail%>
  69.         <% end if %>
  70.     <% else %>
  71.         <% if donext <> "" then %>
  72.             <%= donext %>
  73.         <% end if %>
  74.     <% end if %>
  75. </SCRIPT>
  76. </BODY>
  77. </HTML>
  78.